import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', () => {
  let userAccount = ref('');  //用于储存登录的用户账号
  let hospitalList = ref([]); //用于储存医院列表
  let city = ref(''); //用于储存当前选择的城市
  function setUserAccount(account) {
    userAccount.value = account;
  }
  function setHospitalList(hosp) {
    hospitalList.value = hosp;
  }
  function setCity(cityName) {
    city.value = cityName;
  }

  return {
    userAccount,
    hospitalList,
    city,
    setUserAccount,
    setHospitalList,
    setCity
  };
})